﻿using System;
using System.Net.NetworkInformation;

namespace NDK.LocalUtils
{
    public  class NetHelper
    {
        public static bool PingAds(string ip)
        {
            Ping ping = null;
            try
            {
                ping = new Ping();
                PingReply pingReply = ping.Send(ip);
                return pingReply != null && pingReply.Status == IPStatus.Success;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                ping?.Dispose();
            }
        }
    }
}
